﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DVO;
using DAO;

public partial class HistoryComment : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.User.Identity.Name == "")
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            if (IsPostBack == false)
            {
                LoadData();
            }
        }
    }

    private void LoadData()
    {
        int Id = 0;
        try
        {
            if (!string.IsNullOrEmpty(Request.QueryString["WID"]))
            {
                Id = Convert.ToInt32(Request.QueryString["WID"].ToString());
            }
            BLL_Working ObjBLL = new BLL_Working();
            List<ins_Comment_SelectByDocIdResult> ObjList = new List<ins_Comment_SelectByDocIdResult>();
            ObjList = ObjBLL.Comment_SelectById(Id).ToList();
            grid.DataSource = ObjList;
            grid.DataBind();
        }
        catch (Exception ex)
        {
            Common.WriteLog(ex.Message, ex.StackTrace);
        }
       
       
    }

    public string GetStatus(string Status)
    {
        if (Status == "0")
            return "Chờ kiểm duyệt";
        else if (Status == "1")
            return "Đã duyệt";
        else if (Status == "2")
            return "Chờ review";
        else if (Status == "3")
            return "Chỉnh sửa";
        return "";
    }
}